package com.anycl.spring.soundsystem;

import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
@Setter
public class CDPlayer implements MediaPlayer {

    private CompactDisc cd;

    @Autowired
    public CDPlayer (@Qualifier("compactDisc") CompactDisc cd) {
        this.cd = cd;
    }

    public void play() {
        cd.play();
    }
}
